<template>
  <view class="activeDetailPage">
    <view class="head" :style="[{ height: customBar + 'px' }]">
      <u-navbar
        title="活动详情"
        :autoBack="true"
        :titleStyle="{ fontSize: '34rpx', fontWeight: '500' }"></u-navbar>
    </view>
    <view class="banner">
      <image class="img" :src="HTTP_IMG_URL() + obj.images"></image>
    </view>
    <view class="activeContent">
      <view class="title">
        <view class="status">进行中</view>
        {{ obj.name }}
      </view>
      <view class="acitveTime">
        活动时间：
        <view class="green">{{ obj.activity_time_text }}</view>
      </view>
      <view class="acitveTime">
        <view class="acitveMsg">
          联系人：
          <view class="green">{{ obj.contacts }}</view>
        </view>
        <view class="acitveMsg">
          联系电话：
          <view class="green">{{ obj.contact_number }}</view>
        </view>
      </view>
      <view class="acitveTime">
        活动费用：
        <view class="red">￥{{ obj.price }}</view>
      </view>
    </view>
    <view class="activeContent">
      <view class="title">活动介绍</view>
      <view class="acitveHite" v-html="obj.content"></view>
      <!-- <image class="activeimg" src="@/static/reservation/leftImg.png"></image> -->
    </view>
    <view style="height: 220rpx"></view>
    <view class="footer">
      <view class="money" @click="handleSure">去预约</view>
    </view>
  </view>
</template>

<script>
import { HTTP_IMG_URL } from "../../config/app.js";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      customBar: 99,
      obj: {},
    };
  },
  computed: mapGetters(["isLogin", "uid", "userInfo"]),
  onLoad(params) {
    this.getDetail(params.id);
  },
  methods: {
    HTTP_IMG_URL() {
      return HTTP_IMG_URL;
    },
    handleAll() {
      uni.navigateTo({
        url: "/pages/reservation/album",
      });
    },
    handleSure() {
      uni.navigateTo({
        url: "/pages/reservation/activeorderDetail?id=" + this.obj.id,
      });
    },
    getDetail(id) {
      var that = this;
      that.$Api.reservation
        .activityDetail({
          id: id,
        })
        .then((res) => {
          this.obj = res.data;
          console.log(res.data, 23);
        });
    },
  },
};
</script>

<style lang="scss">
.activeDetailPage {
  height: 100%;
  min-height: 100vh;
  font-family: PingFang SC;
  background: #f5f5f4;
  padding-bottom: calc(env(safe-area-inset-bottom) / 2);
  .head {
    background: #fff;
  }
  .banner {
    width: 100%;
    height: 420rpx;
    .img {
      width: 100%;
      height: 100%;
    }
  }
  .activeContent {
    width: 100%;
    background: #fff;
    padding: 26rpx 38rpx;
    box-sizing: border-box;
    text-align: justify;
    .title {
      display: flex;
      font-weight: 500;
      font-size: 36rpx;
      color: #000000;
      align-items: center;
      .status {
        width: 113rpx;
        height: 40rpx;
        // background: #a3c616;
        background: url("../../static/reservation/status.png") no-repeat;
        background-size: 100% 100%;
        color: #fff;
        font-size: 28rpx;
        text-align: center;
        margin-right: 10rpx;
      }
    }
    .activeimg {
      margin-top: 20rpx;
      width: 100%;
    }
    .acitveTime {
      font-family: SourceHanSansCN, SourceHanSansCN;
      font-weight: 400;
      font-size: 28rpx;
      color: #999ca7;
      display: flex;
      margin-top: 24rpx;
      .green {
        color: #a3c616;
        font-size: 30rpx;
      }
      .red {
        color: #fd463e;
        font-size: 30rpx;
      }
    }
    .acitveHite {
      font-size: 28rpx;
      color: #999ca7;
      line-height: 48rpx;
      margin-top: 18rpx;
    }
    .acitveMsg {
      display: flex;
      justify-content: space-between;
    }
    .acitveMsg:nth-child(2) {
      margin-left: 120rpx;
    }
  }

  .footer {
    width: 100%;
    height: 190rpx;
    position: fixed;
    // bottom: calc(env(safe-area-inset-bottom) / 2);
    bottom: 0;
    background: #fff;
    box-shadow: 0rpx -4rpx 8rpx 0rpx rgba(0, 0, 0, 0.1);
    padding: 20rpx 38rpx;
    box-sizing: border-box;

    .money {
      width: 100%;
      height: 88rpx;
      line-height: 88rpx;
      text-align: center;
      color: #fff;
      background: #a3c616;
      box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(163, 198, 22, 0.3);
      border-radius: 24rpx;
      font-weight: 500;
      font-size: 34rpx;
      margin-top: 18rpx;
    }
  }
}
</style>
